package com.lscl.rabbitmq.config;

import org.springframework.amqp.core.Queue;
import org.springframework.amqp.core.QueueBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.HashMap;
import java.util.Map;

/**
 * 测试TTL
 */
//@Configuration
public class Config_04_TTL {
    @Bean("testQueueTtl")
    public Queue testQueueTtl() {

        Map<String, Object> params = new HashMap<>();
        params.put("x-message-ttl", 5000);

        return QueueBuilder.durable("test_queue_ttl").withArguments(params).build();
    }
}
